<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.tjsinfo.tjsoa.mail.vo.Tjsmail"%>
<%@page import="com.tjsinfo.tjsoa.mail.vo.TjsAnnex"%>
<%@page import="com.tjsinfo.tjsoa.common.ToolKit"%>
<%@page import="com.tjsinfo.tjsoa.common.SessionUser"%>
<%@page import="com.tjsinfo.tjsoa.system.vo.User"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String nowSQL = ToolKit.getProperties("com/tjsinfo/tjsoa/mail/properties/systemResource.properties", this).getProperty("nowSQL");
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>粮油集团办公自动化协作平台</title>
<link href="<%=basePath %>style/txlz7.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>style/red.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>ajaxFramework/ext/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>js/ie.js"></script>
<script type="text/javascript" src="<%=basePath%>js/png.js"></script>
<style >
	#uploadList li {
		float:  left;
		margin-right:  10px;
		width: 100%
	}
		.silk-del{
        background-image:url(<%=basePath %>ajaxFramework/ext-2.1/shared/icons/fam/delete.gif) !important;
</style>
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
--> 

<link href="<%=basePath %>ajaxFramework/ext/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>ajaxFramework/uploadify/css/uploadify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext/ext-base.js"></script>
<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext/ext-all.js"></script>
<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/init.js"></script>
<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext/ux/ux-all.js"></script>	
<script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery-1.5.1.js"></script>
<script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery.form.js"></script>
<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext/extension/window/window.js"></script>
<script type="text/javascript" src="<%=basePath %>js/common/global/validator.js"></script>
<script type="text/javascript" src="<%=basePath %>js/common/global/pageControl.js"></script>
<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxfileupload.js"></script>
<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxFileZx.js"></script>
<script type="text/javascript" src="<%=basePath%>FCKeditor/fckeditor.js"></script>
<script type="text/javascript" src="<%=basePath %>email/js/email.js"></script>
<script type="text/javascript" src="<%=basePath %>email/js/writemailfrom.js"></script>
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/uploadify/jquery.uploadify.min.js"></script>
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/uploadify/TsystemUpload.js"></script>	
	<%--
	<script type="text/javascript">
	function peopleTree(){
		var win = userinfochecktree(<%=nowSQL %>,<%=SessionUser.getUserId(request) %>);
		win.show();
		win.on("winsubmint",function(data){
			document.getElementById('jubaorename').value = data.usernametext;
			document.getElementById('jubaorenid').value = data.usertext;
			win.hide();
			if(document.getElementById('writeName').value!=''){
				document.getElementById('jubaorename').value += ','+document.getElementById('writeName').value;
			}
		});
	}
	</script>
	<!-- 结束 -->
	<script type="text/javascript">
	//初始化方法
	function init(){
	  initselectusertreecheck();	  
	}
	//定义初始化程序
	window.onload = init;
	</script>--%>
	<script type="text/javascript">
		function submitform()
		{
			var uuuuuuu = document.getElementById('uuuuuuu').value;
			var contest= document.getElementById('contest').value;
			var title = document.getElementById('title').value;
			//for(var a = 0; a<length; a++)
			//{
			//	var check1 = checkbox2[a].value;
			//	sendusers += check1+",";	
			//}
			if(title == ''){
				Ext.MessageBox.alert('提示框','<nobr>请输入主题<nobr>');
				return;
			}else{
				document.getElementById('title').value = title.substring(0,title.length);
				document.form1.submit();
			}
		}		
		function back()
		{
			history.back(-1);
		}
		function clearinputtwo(_name,_id){
			$('#'+_name).attr('value','');
			$('#'+_id).attr('value','');
			$('#jubaorenInput').attr('value','');
			//$('#writeName').attr('value','');
		}
		function changdiv(){
			// mail_right.scrollIntoView();
			 //mail_right.scrollTop=mail_right.scrollHeight
		}
		
		window.onload = function(){
			//initselectusercheck();
			//document.getElementById("mail_right").style.height = document.body.clientHeight-60;
		}
		
		<%--Ext.onReady(function(){
       			 Ext.QuickTips.init();
        
        // 格式化数据，数据也可采用json数据
		var ds = new Ext.data.JsonStore({
	 		fields:['userId','userName'],
	 		url:'<%=basePath %>tjsinfo/tjsoa/system/selectUserByName.do',
 			root: 'root'
	 	});--%>
		
	//});
		
	</script>
	<script language="javascript">
	if(document.addEventListener){//如果是Firefox
		document.addEventListener("onkeydown",fireFoxHandler, true);
	}else{
		document.attachEvent("onkeydown",ieHandler);
	}
	function fireFoxHandler(evt){
		//alert("firefox");
		if(evt.keyCode==13){
			submitform();
		}
	}
	function ieHandler(evt){
		//alert("IE");
		if(evt.keyCode==13){
			submitform();
		}
	}
	
	</script>
<!-- 执行上传文件操作的函数 -->
<script type="text/javascript">
		var deleteFile;
		var alreadyUploadFile='';
		var uploadUrl='<%=basePath %>tjsinfo/tjsoa/system/ajaxFileUpload.do?method=uploader';
		var deteleFileUrl='<%=basePath %>tjsinfo/tjsoa/system/ajaxFileUpload.do?method=deleted';
	</script>
</head>
<body style="height:595px;">
  <div id="rightindex" style="height: 595px;">
		<div id="mailcontent" > 
			<div id="mail_title">
                <ul></ul>
            </div>
            
            <div id="mail_left" style="height: 94%">
                <div class="p_01">
                    <a  href="<%=basePath %>tjsinfo/tjsoa/mail/emailReceivedList.do" class="a1"><img src="<%=basePath %>images/mailicon03.gif" /></a><a href="<%=basePath %>tjsinfo/tjsoa/mail/writemailfrom.do" class="a2"><img src="<%=basePath %>images/mailicon04.gif" /></a>
                </div>
              <h1>
                </h1>
                <div class="p_02">
                <ul>
                    <li class="l_01"><a href="<%=basePath %>tjsinfo/tjsoa/mail/emailReceivedList.do">收件箱</a></li>
                    <li class="l_05"><a href="<%=basePath %>tjsinfo/tjsoa/mail/emailWeiReadReceived.do">未读邮件</a></li>
                    <li class="l_02"><a href="<%=basePath %>tjsinfo/tjsoa/mail/emailDraftList.do">草稿箱</a></li>
                    <li class="l_03"><a href="<%=basePath %>tjsinfo/tjsoa/mail/selectEmaiList.do">已发送</a></li>
                    <li class="l_04"><a href="<%=basePath %>tjsinfo/tjsoa/mail/deleteEmaiList.do">已删除</a></li>
                    <c:forEach var="fold" items="${foldlist}">
                    <li class="l_05"><a href="<%=basePath%>tjsinfo/tjsoa/mail/selectfoldemail.do?id=${fold.folderId}">${fold.folderName}</a></li>
                    </c:forEach>            
                </ul>
                </div>
                <div class="p_03">
                    <div class="s01">
                      <table width="100%" border="0" cellspacing="0">
                        <tr>
                          <td height="25"><strong></strong></td>
                        </tr>
                        <tr>
                          <td height="25"></td>
                        </tr>
                        <tr>
                          <td height="25"></td>
                        </tr>
                      </table>
                    </div>
                </div>
            </div>
  <form name="form1" action="<%=basePath %>tjsinfo/tjsoa/mail/writemail2.do" method="post" id="form1">  
            <div id="mail_right" style="height: 98%" >
             <div class="p_11" style="width:99%">
                <ul>
                    <li class="s01"><a href="javascript:submitform()">发送</a></li>
                    <li class="s04"><a href="javascript:back()">取消</a></li>                  
                </ul>
	          </div>
             <div class="p_80"style="height: 99%">
              <table width="100%" border="0" cellspacing="0" align="left">
                <tr>
                  <td width="5px;">
                  	<!-- <a href="javascript:selectusercheckwinshow('jubaorenid','jubaorename','node')" > -->
                  	<a>
                  		<img src="<%=basePath %>images/m_icon118.gif" width="67" height="22" />
                  	</a>
                  </td>
                  <td width="5px;">
                  <div id="show" style="width: 200px"></div>
                  	<!-- <input id="jubaorename"  name="test" size="30" readonly="readonly" style="height:17px;width:500px; margin-bottom:5px" onclick="javascript:showPeople('收件人');"/> -->
                  	<input name="uuuuuuu" id="uuuuuuu" value="${tjsmail.tjsmailUsername}" readonly="readonly" style="height:17px;width:500px; margin-bottom:5px">
                  	<input type="hidden" id="sendusers" name="sendusers"/>
                  </td>
                  <td>
                  </td>
                </tr>
                <tr>
                  <td width="5px;">
                  	<img src="<%=basePath %>images/m_icon211.gif" width="67" height="22" />
                  </td>
                  <td colspan="2">
                  	<input name="title" id="title" size="30" maxlength="20" style="height:17px;width:500px; margin-bottom:0px"/>
                  </td>
                </tr>
                <tr>
					<td width="5px;">
	                  	<img src="<%=basePath %>images/m_icon212.gif" width="67" height="21" />
	                </td>
	                <td width="250px" colspan="2">
	                	<table cellpadding="0" cellspacing="0">
	                	<tr><td align="left" class="value" id="filediv">
	                	<span><input type="file" UNSELECTABLE="on"  name="uploadFile" id="uploadFile" size="34" class="textinput" style="margin-bottom:0px" /></span>
	                	</td>
	                	</tr>
	                	</table>
	                </td>
                </tr>
                <tr>
                  <td colspan="3"><textarea name="contest" id="contest"
						style="width: 100%; height: 595px;"></textarea>
						<script type="text/javascript">
						var oFCKeditor = new FCKeditor( 'contest' ) ;
						oFCKeditor.BasePath = 'FCKeditor/' ;
						oFCKeditor.ToolbarSet = 'Zoa' ;
						oFCKeditor.Width = '98%' ;
						oFCKeditor.Height = '400px' ;
						oFCKeditor.Value = '' ;
						oFCKeditor.ReplaceTextarea(); 
						//oFCKeditor.Create() ;
                        </script>
				  </td>
                </tr>
              </table>
            </div> 
            </div>
            
		<input type="hidden" name="sendid" id="jubaorenid" value="${tjsmail.tjsmailUserid},${tjsmail.tjsmailUsername},${tjsmail.sendSql}@"/>
		<input  type="hidden" name="sendInput" id="jubaorenInput"/>
        <input  type="hidden" name="writeName" id="writeName"/>
		<input type="hidden" name="chaosongid" id="chaosongid"/>
		<input type="hidden" name="misongid" id="misongid"/>
		<input type="hidden" name="fujianname1" id="fujianname1"/>
		<input id="basePath" value="<%=basePath%>" type="hidden"/> 
		<div id="files" style="display: none;"></div>
		</form>
   </div>
</div>
<form action="" name="form2" method="post">
</form>
  </body>
</html>
